<template>
  <div class="header">
    <div class="tips">
      那一年我21岁，在我一生的黄金时代。我有好多奢望。我想爱，想吃，还想瞬间变成天上半明半暗的云。
      后来我才知道，生活就是一个缓慢受捶的过程，人一天天老下去，奢望也一天天消逝，最后变得像挨了捶的牛一样。可是我过21岁生日的时候没有遇见这一点。我觉得自己会永远生猛下去，什么也捶不了我。
      <!-- <img src="../assets/logo.png" @click="gohome" alt="" /> -->
    </div>
    <div class="out" @click="go_out">
      <el-avatar
        src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
      ></el-avatar>
      <span>退出登录</span>
    </div>
  </div>
</template>
<script>
import { reactive, toRefs } from "vue";
import { ElMessage } from "element-plus";
import { useRouter } from "vue-router";
import { localRemove } from "../utils/index";
export default {
  setup() {
    const router = useRouter();
    const state = reactive({
      msg: "header",
    });
    const go_out = () => {
      router.push("/login");
      localRemove("token");
      ElMessage.success("success");
    };
    const gohome = () => {
      router.push("/index");
    };
    return {
      go_out,
      gohome,
      ...toRefs(state),
    };
  },
};
</script>
<style lang='scss' scoped>
.header {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  .tips{
    width: 70vw;
    line-height: 20px;
    font-family: cursive;
    font-size: 16px;
  }
  img {
    width: 50px;
    height: 50px;
    margin-left: 20px;
    cursor: pointer;
  }
  .out {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 16px;
    span {
      margin-left: 10px;
    }
  }
}
</style>